 
import { EntityDB } from "GameLoop/WorldState/EntityManager/EntityDB";
import { PollingStationManager } from "GameLoop/WorldState/PollingStation/PollingStationManager";


export interface WorldGetter
{
    EntityDB:EntityDB
    Station:PollingStationManager
    registerNotify(region:EventRegion,eventtype:INotifyEvent):void
}


export abstract class ABaseDecision<U extends TaskType,T extends TEventTypes=TEventTypes>
{
    protected WorldGetter:WorldGetter
    constructor(WorldGetter:WorldGetter)
    {
        this.WorldGetter = WorldGetter;
    }
    
    abstract isExpired(event:IWorldEvents[T],region:EventRegion):boolean;
    abstract makeTask(event:IWorldEvents[T],region:EventRegion):IDecisionCode<U>|false;

    public get entityDB()
    {
        return this.WorldGetter.EntityDB
    }
}